<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader: CRC32</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Common bootloader for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__crc32.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a>  </div>
  <div class="headertitle">
<div class="title">CRC32<div class="ingroups"><a class="el" href="group__crc.html">CRC</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>32-bit CRC  
<a href="#details">More...</a></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for CRC32:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<center><table><tr><td><div class="center"><iframe scrolling="no" frameborder="0" src="group__crc32.svg" width="171" height="38"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</td></tr></table></center>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcrc32__data__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__crc32.html#structcrc32__data__t">crc32_data_t</a></td></tr>
<tr class="memdesc:structcrc32__data__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">State information for the CRC32 algorithm.  <a href="group__crc32.html#structcrc32__data__t">More...</a><br /></td></tr>
<tr class="separator:structcrc32__data__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
CRC32</h2></td></tr>
<tr class="memitem:gaedb7618c0c72b70836b6fee46a0052bb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__crc32.html#gaedb7618c0c72b70836b6fee46a0052bb">crc32_init</a> (<a class="el" href="group__crc32.html#structcrc32__data__t">crc32_data_t</a> *crc32Config)</td></tr>
<tr class="memdesc:gaedb7618c0c72b70836b6fee46a0052bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the parameters of the crc function, must be called first.  <a href="#gaedb7618c0c72b70836b6fee46a0052bb">More...</a><br /></td></tr>
<tr class="separator:gaedb7618c0c72b70836b6fee46a0052bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga72968d401e2cb99b1426973264bf3563"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__crc32.html#ga72968d401e2cb99b1426973264bf3563">crc32_update</a> (<a class="el" href="group__crc32.html#structcrc32__data__t">crc32_data_t</a> *crc32Config, const uint8_t *src, uint32_t lengthInBytes)</td></tr>
<tr class="memdesc:ga72968d401e2cb99b1426973264bf3563"><td class="mdescLeft">&#160;</td><td class="mdescRight">A "running" crc calculator that updates the crc value after each call.  <a href="#ga72968d401e2cb99b1426973264bf3563">More...</a><br /></td></tr>
<tr class="separator:ga72968d401e2cb99b1426973264bf3563"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2676e146d94a5fc807caa6652adb76e9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__crc32.html#ga2676e146d94a5fc807caa6652adb76e9">crc32_finalize</a> (<a class="el" href="group__crc32.html#structcrc32__data__t">crc32_data_t</a> *crc32Config, uint32_t *hash)</td></tr>
<tr class="memdesc:ga2676e146d94a5fc807caa6652adb76e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the final crc value, padding with zeros if necessary, must be called last.  <a href="#ga2676e146d94a5fc807caa6652adb76e9">More...</a><br /></td></tr>
<tr class="separator:ga2676e146d94a5fc807caa6652adb76e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Usage Information</h2>
<p>32-bit CRC </p>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcrc32__data__t" id="structcrc32__data__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct crc32_data_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>State information for the CRC32 algorithm. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a297690e32e997b73286168b7ecef03e4"></a>uint32_t</td>
<td class="fieldname">
byteCountCrc</td>
<td class="fielddoc">
Number of bytes processed. </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="af4241c81b7736d2d1ec0ab064ece5912"></a>uint32_t</td>
<td class="fieldname">
currentCrc</td>
<td class="fielddoc">
Current CRC value. </td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga2676e146d94a5fc807caa6652adb76e9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void crc32_finalize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__crc32.html#structcrc32__data__t">crc32_data_t</a> *&#160;</td>
          <td class="paramname"><em>crc32Config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>hash</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculates the final crc value, padding with zeros if necessary, must be called last. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">crc32Config</td><td>Instantiation of the data structure of type <a class="el" href="group__crc32.html#structcrc32__data__t" title="State information for the CRC32 algorithm. ">crc32_data_t</a> </td></tr>
    <tr><td class="paramname">hash</td><td>Pointer to the value returned for the final calculated crc value </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaedb7618c0c72b70836b6fee46a0052bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void crc32_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__crc32.html#structcrc32__data__t">crc32_data_t</a> *&#160;</td>
          <td class="paramname"><em>crc32Config</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the parameters of the crc function, must be called first. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">crc32Config</td><td>Instantiation of the data structure of type <a class="el" href="group__crc32.html#structcrc32__data__t" title="State information for the CRC32 algorithm. ">crc32_data_t</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga72968d401e2cb99b1426973264bf3563"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void crc32_update </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__crc32.html#structcrc32__data__t">crc32_data_t</a> *&#160;</td>
          <td class="paramname"><em>crc32Config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>lengthInBytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>A "running" crc calculator that updates the crc value after each call. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">crc32Config</td><td>Instantiation of the data structure of type <a class="el" href="group__crc32.html#structcrc32__data__t" title="State information for the CRC32 algorithm. ">crc32_data_t</a> </td></tr>
    <tr><td class="paramname">src</td><td>Pointer to the source buffer of data </td></tr>
    <tr><td class="paramname">lengthInBytes</td><td>The length, given in bytes (not words or long-words) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
  </table>
  </dd>
</dl>
<p>Note: We must init CRC module here, As we may seperate one crc calculation into several times Note: It is better to use lock to ensure the integrity of current updating operation of crc calculation </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 7 2016 16:48:23 for Kinetis Bootloader by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
